﻿using System.Configuration;
using System.Data;
using System.Windows;
using System.Reflection;
using System.Windows;
using Microsoft.Win32;

namespace e11;

public partial class App : Application
{





/*


; 安装完成后执行初始化逻辑 
[Run]
Filename: "{app}\MyApp.exe"; Parameters: "install_init__"; Flags: nowait postinstall

; inno setup 脚本添加命令  (重要)
[UninstallRun]
Filename: "{app}\{#MyAppExeName}"; Parameters: "uninstall_clean__";

*/
    protected override void OnStartup(StartupEventArgs e)
    {
        base.OnStartup(e);

        if (e.Args.Length > 0)
        {
            string arg = e.Args[0];

            if (arg == "uninstall_clean__")
            {
                MessageBox.Show("是卸载程序吗???");
                Registry_Cleaner_CurrentUser.Delete_App_Shell_Keys(MyConfig.AppName);
                
                Application.Current.Shutdown();
                return;
            }
            else if (arg == "install_init__")
            {
                MessageBox.Show("安装初始化......");
                // Registry_Cleaner_CurrentUser.Create_App_Shell_Keys(MyConfig.AppName);
                // 也可以执行其他安装后初始化操作
             
                Application.Current.Shutdown();
                return;
            }
        }
    }

    
    
    
    
    
    
    
    
    
    
    
    
    
}